* APPENDIX D
use "data_brasil_camp.dta", clear
	
* Table D.1.
eststo clear	
local dep_var "rerun"

	* 0. Baseline: Average causal Impact of Information Disclosure.
		eststo `dep_var'_basic: quietly areg `dep_var' before i.term , absorb(codigo_uf) robust cluster($cluster)
				sum `dep_var' if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_basic

		* 0.1. baseline + controls
		eststo `dep_var'_basic_c: quietly areg `dep_var' before $muni_controls $mayor_controls i.term , absorb(codigo_uf) robust cluster($cluster)
				sum `dep_var' if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_basic_c
				estadd local mayor_municipal "\checkmark": `dep_var'_basic_c


	* 1. Broad				
		eststo `dep_var'_broad: quietly areg `dep_var' before broad before_broad i.term , absorb(codigo_uf) robust cluster($cluster)
				* Add mean dependent variable
				sum `dep_var' if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_broad
				lincom before + before_broad
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': `dep_var'_broad
				estadd local p_value `p_test': `dep_var'_broad

		*1.2. broad + controls			
		eststo `dep_var'_broad_c: quietly areg `dep_var' before broad before_broad  $muni_controls $mayor_controls i.term , absorb(codigo_uf) robust cluster($cluster)
				sum `dep_var' if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_broad_c
				estadd local mayor_municipal "\checkmark": `dep_var'_broad_c
				lincom before + before_broad
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': `dep_var'_broad_c
				estadd local p_value `p_test': `dep_var'_broad_c				

	* 2. fraction_broad		
		eststo `dep_var'_fraction: quietly areg `dep_var' before fraction_broad corrupt_before i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum `dep_var' if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_fraction
				sum fraction_broad if e(sample), mean 
				loc my_mean: display %9.3f r(mean)				
				lincom before + corrupt_before * `my_mean'	
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': `dep_var'_fraction
				estadd local p_value `p_test': `dep_var'_fraction		
				
		*2.2 fraction_broad + controls			
		eststo `dep_var'_fraction_c: quietly areg `dep_var' before fraction_broad corrupt_before $muni_controls $mayor_controls  i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum `dep_var' if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_fraction_c
				estadd local mayor_municipal "\checkmark": `dep_var'_fraction_c
				sum fraction_broad if e(sample), mean 
				loc my_mean: display %9.3f r(mean)				
				lincom before + corrupt_before * `my_mean'	
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': `dep_var'_fraction_c
				estadd local p_value `p_test': `dep_var'_fraction_c
								
	* 3. above_median_broad 							
		eststo `dep_var'_median: quietly areg `dep_var' before above_median_corrupt median_before i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum `dep_var' if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_median
				lincom before + median_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': `dep_var'_median
				estadd local p_value `p_test': `dep_var'_median

		*3.2. above_median_broad + controls	(Preferred specification)
		eststo `dep_var'_median_c: quietly areg `dep_var' before above_median_corrupt median_before $muni_controls $mayor_controls i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum `dep_var' if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_median_c
				estadd local mayor_municipal "\checkmark": `dep_var'_median_c
				lincom before + median_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': `dep_var'_median_c
				estadd local p_value `p_test': `dep_var'_median_c

	* 4. quartiles broad
		eststo `dep_var'_quart:   quietly areg `dep_var' before quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before i.term, absorb(codigo_uf) robust cluster($cluster)
				sum `dep_var' if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_quart
				lincom before + quart4_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': `dep_var'_quart
				estadd local p_value `p_test': `dep_var'_quart

		*4.2 quartiles broad + controls
		eststo `dep_var'_quart_c: quietly areg `dep_var' before quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before $muni_controls $mayor_controls   i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum `dep_var' if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_quart_c
				estadd local mayor_municipal "\checkmark": `dep_var'_quart_c
				lincom before + quart4_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': `dep_var'_quart_c
				estadd local p_value `p_test': `dep_var'_quart_c
						
					
* EXPORT TABLE TO LATEX		
		#delimit;
			esttab `dep_var'_basic `dep_var'_basic_c `dep_var'_broad `dep_var'_broad_c `dep_var'_fraction `dep_var'_fraction_c `dep_var'_median `dep_var'_median_c `dep_var'_quart `dep_var'_quart_c
			using "tables and figures/table_d1.tex", b(3) se compress label star(* 0.10 ** 0.05 *** 0.01) replace
			mgroups( "\shortstack{Information \\ disclosure}" "Corruption"   "Share corruption"  "\shortstack{Median \\ Corruption}"   "\shortstack{Quartiles\\ Corruption}"  , pattern(1 0 1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) 
			keep(before_broad before broad corrupt_before fraction_broad median_before above_median_corrupt quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before ) 
			stats(N mD mayor_municipal state_fe r2_a b0_b2 p_value, fmt(%9.0fc %9.3fc ) labels("Observations" "Dep. Var. Mean" "Mayor and municipal controls" "State and term FE" "Adjusted R$^2$" "$\beta_0+\beta_2 \, c_{ist}$" "p-value"))
			/*nonum*/ ar2 booktabs nonotes nomtitles title(deletethis) 
			substitute(\begin{table}[htbp]\centering \centering \caption{deletethis} /*\footnotesize*/{ \end{tabular} \end{tabular}} \end{table} %);
			#delimit cr




* Table D.2
 eststo clear	
foreach dep_var of varlist total_cand {
 

	* 0. Baseline: Average causal Impact of Information Disclosure.
		eststo `dep_var'_basic: quietly areg `dep_var' before i.term , absorb(codigo_uf) robust cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_basic

		* 0.1. baseline + controls
		eststo `dep_var'_basic_c: quietly areg `dep_var' before $muni_controls $mayor_controls i.term , absorb(codigo_uf) robust cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_basic_c
				estadd local mayor_municipal "\checkmark": `dep_var'_basic_c
	
	* 1. Broad				
		eststo `dep_var'_broad: quietly areg `dep_var' before broad before_broad i.term , absorb(codigo_uf) robust cluster($cluster)
				* Add mean dependent variable
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_broad
				lincom before + before_broad
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': `dep_var'_broad
				estadd local p_value `p_test': `dep_var'_broad

		*1.2. broad + controls			
		eststo `dep_var'_broad_c: quietly areg `dep_var' before broad before_broad  $muni_controls $mayor_controls i.term , absorb(codigo_uf) robust cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_broad_c
				estadd local mayor_municipal "\checkmark": `dep_var'_broad_c
				lincom before + before_broad
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': `dep_var'_broad_c
				estadd local p_value `p_test': `dep_var'_broad_c				

	* 2. fraction_broad		
		eststo `dep_var'_fraction: quietly areg `dep_var' before fraction_broad corrupt_before i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_fraction
				sum fraction_broad if e(sample), mean 
				loc my_mean: display %9.3f r(mean)				
				lincom before + corrupt_before * `my_mean'	
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': `dep_var'_fraction
				estadd local p_value `p_test': `dep_var'_fraction		
				
		*2.2 fraction_broad + controls			
		eststo `dep_var'_fraction_c: quietly areg `dep_var' before fraction_broad corrupt_before $muni_controls $mayor_controls  i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_fraction_c
				estadd local mayor_municipal "\checkmark": `dep_var'_fraction_c
				sum fraction_broad if e(sample), mean 
				loc my_mean: display %9.3f r(mean)				
				lincom before + corrupt_before * `my_mean'	
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': `dep_var'_fraction_c
				estadd local p_value `p_test': `dep_var'_fraction_c
							
	* 3. above_median_broad 							
		eststo `dep_var'_median: quietly areg `dep_var' before above_median_corrupt median_before i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_median
				lincom before + median_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': `dep_var'_median
				estadd local p_value `p_test': `dep_var'_median

		*3.2. above_median_broad + controls	(Preferred specification)
		eststo `dep_var'_median_c: quietly areg `dep_var' before above_median_corrupt median_before $muni_controls $mayor_controls i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_median_c
				estadd local mayor_municipal "\checkmark": `dep_var'_median_c
				lincom before + median_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': `dep_var'_median_c
				estadd local p_value `p_test': `dep_var'_median_c

	* 4. quartiles broad
		eststo `dep_var'_quart:   quietly areg `dep_var' before quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before i.term, absorb(codigo_uf) robust cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_quart
				lincom before + quart4_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': `dep_var'_quart
				estadd local p_value `p_test': `dep_var'_quart

		*4.2 quartiles broad + controls
		eststo `dep_var'_quart_c: quietly areg `dep_var' before quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before $muni_controls $mayor_controls   i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_quart_c
				estadd local mayor_municipal "\checkmark": `dep_var'_quart_c
				lincom before + quart4_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': `dep_var'_quart_c
				estadd local p_value `p_test': `dep_var'_quart_c

* total_cand mean_educ mean_skilled mean_age 
			esttab `dep_var'_basic `dep_var'_basic_c `dep_var'_broad `dep_var'_broad_c `dep_var'_fraction `dep_var'_fraction_c `dep_var'_median `dep_var'_median_c `dep_var'_quart `dep_var'_quart_c ///
			using "tables and figures\table_d2.tex", b(3) se compress label star(* 0.10 ** 0.05 *** 0.01) replace ///
			mgroups( "\shortstack{Information \\ disclosure}" "Corruption"   "Share corruption"  "\shortstack{Median \\ Corruption}"   "\shortstack{Quartiles\\ Corruption}"  , pattern(1 0 1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))  ///
			keep(before_broad before broad corrupt_before fraction_broad median_before above_median_corrupt quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before ) /// 
			stats(N mD mayor_municipal state_fe r2_a b0_b2 p_value, fmt(%9.0fc %9.3fc ) labels("Observations" "Dep. Var. Mean" "Mayor and municipal controls" "State and term FE" "Adjusted R$^2$" "$\beta_0+\beta_2 \, c_{ist}$" "p-value")) ///
			/*nonum*/ ar2 booktabs nonotes nomtitles title(deletethis) ///
			substitute(\begin{table}[htbp]\centering \centering \caption{deletethis} /*\footnotesize*/{ \end{tabular} \end{tabular}} \end{table} %)

}

* table d.3
 eststo clear	
foreach dep_var of varlist mean_educ {
 

	* 0. Baseline: Average causal Impact of Information Disclosure.
		eststo `dep_var'_basic: quietly areg `dep_var' before i.term , absorb(codigo_uf) robust cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_basic

		* 0.1. baseline + controls
		eststo `dep_var'_basic_c: quietly areg `dep_var' before $muni_controls $mayor_controls i.term , absorb(codigo_uf) robust cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_basic_c
				estadd local mayor_municipal "\checkmark": `dep_var'_basic_c
	
	* 1. Broad				
		eststo `dep_var'_broad: quietly areg `dep_var' before broad before_broad i.term , absorb(codigo_uf) robust cluster($cluster)
				* Add mean dependent variable
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_broad
				lincom before + before_broad
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': `dep_var'_broad
				estadd local p_value `p_test': `dep_var'_broad

		*1.2. broad + controls			
		eststo `dep_var'_broad_c: quietly areg `dep_var' before broad before_broad  $muni_controls $mayor_controls i.term , absorb(codigo_uf) robust cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_broad_c
				estadd local mayor_municipal "\checkmark": `dep_var'_broad_c
				lincom before + before_broad
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': `dep_var'_broad_c
				estadd local p_value `p_test': `dep_var'_broad_c				

	* 2. fraction_broad		
		eststo `dep_var'_fraction: quietly areg `dep_var' before fraction_broad corrupt_before i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_fraction
				sum fraction_broad if e(sample), mean 
				loc my_mean: display %9.3f r(mean)				
				lincom before + corrupt_before * `my_mean'	
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': `dep_var'_fraction
				estadd local p_value `p_test': `dep_var'_fraction		
				
		*2.2 fraction_broad + controls			
		eststo `dep_var'_fraction_c: quietly areg `dep_var' before fraction_broad corrupt_before $muni_controls $mayor_controls  i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_fraction_c
				estadd local mayor_municipal "\checkmark": `dep_var'_fraction_c
				sum fraction_broad if e(sample), mean 
				loc my_mean: display %9.3f r(mean)				
				lincom before + corrupt_before * `my_mean'	
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': `dep_var'_fraction_c
				estadd local p_value `p_test': `dep_var'_fraction_c
							
	* 3. above_median_broad 							
		eststo `dep_var'_median: quietly areg `dep_var' before above_median_corrupt median_before i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_median
				lincom before + median_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': `dep_var'_median
				estadd local p_value `p_test': `dep_var'_median

		*3.2. above_median_broad + controls	(Preferred specification)
		eststo `dep_var'_median_c: quietly areg `dep_var' before above_median_corrupt median_before $muni_controls $mayor_controls i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_median_c
				estadd local mayor_municipal "\checkmark": `dep_var'_median_c
				lincom before + median_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': `dep_var'_median_c
				estadd local p_value `p_test': `dep_var'_median_c

	* 4. quartiles broad
		eststo `dep_var'_quart:   quietly areg `dep_var' before quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before i.term, absorb(codigo_uf) robust cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_quart
				lincom before + quart4_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': `dep_var'_quart
				estadd local p_value `p_test': `dep_var'_quart

		*4.2 quartiles broad + controls
		eststo `dep_var'_quart_c: quietly areg `dep_var' before quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before $muni_controls $mayor_controls   i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_quart_c
				estadd local mayor_municipal "\checkmark": `dep_var'_quart_c
				lincom before + quart4_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': `dep_var'_quart_c
				estadd local p_value `p_test': `dep_var'_quart_c

* total_cand mean_educ mean_skilled mean_age 
			esttab `dep_var'_basic `dep_var'_basic_c `dep_var'_broad `dep_var'_broad_c `dep_var'_fraction `dep_var'_fraction_c `dep_var'_median `dep_var'_median_c `dep_var'_quart `dep_var'_quart_c ///
			using "tables and figures\table_d3.tex", b(3) se compress label star(* 0.10 ** 0.05 *** 0.01) replace ///
			mgroups( "\shortstack{Information \\ disclosure}" "Corruption"   "Share corruption"  "\shortstack{Median \\ Corruption}"   "\shortstack{Quartiles\\ Corruption}"  , pattern(1 0 1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))  ///
			keep(before_broad before broad corrupt_before fraction_broad median_before above_median_corrupt quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before ) /// 
			stats(N mD mayor_municipal state_fe r2_a b0_b2 p_value, fmt(%9.0fc %9.3fc ) labels("Observations" "Dep. Var. Mean" "Mayor and municipal controls" "State and term FE" "Adjusted R$^2$" "$\beta_0+\beta_2 \, c_{ist}$" "p-value")) ///
			/*nonum*/ ar2 booktabs nonotes nomtitles title(deletethis) ///
			substitute(\begin{table}[htbp]\centering \centering \caption{deletethis} /*\footnotesize*/{ \end{tabular} \end{tabular}} \end{table} %)

}

 
	 
* Table D.4

gen preselection_auditing = 0
	replace preselection_auditing = 1 if month3_12 == 1
	
		label var preselection_auditing "Preselection Auditing"
		capture gen preselection_auditing_broad = preselection_auditing * broad
				label var preselection_auditing_broad "Preselection Auditing $\times$ corruption"
				label var broad "Corruption"
				
		capture gen corrupt_preselection_auditing = preselection_auditing * fraction_broad
				label var corrupt_preselection_auditing "Preselection Auditing $\times$ share corruption"
				label var fraction_broad "Share corruption"
		
		capture gen median_preselection_auditing = preselection_auditing * above_median_corrupt
				label var median_preselection_auditing "Preselection Auditing $\times$ Above median corruption"
	
		  gen quart2_preselection_auditing = preselection_auditing * quartile2
		  gen quart3_preselection_auditing = preselection_auditing * quartile3
		  gen quart4_preselection_auditing = preselection_auditing * quartile4
				label var quart2_preselection_auditing "Preselection Auditing $\times$ 2nd quartile of corruption"
				label var quart3_preselection_auditing "Preselection Auditing $\times$ 3rd quartile of corruption"
				label var quart4_preselection_auditing "Preselection Auditing $\times$ 4th quartile of corruption"
				label var quartile1 "1st quartile of corruption"
				label var quartile2 "2nd quartile of corruption"
				label var quartile3 "3rd quartile of corruption"
				label var quartile4 "4th quartile of corruption"	

eststo clear	
local dep_var "rerun"

	* 0. Baseline: Average causal Impact of Information Disclosure.
		eststo `dep_var'_basic: quietly areg `dep_var' preselection_auditing i.term , absorb(codigo_uf) robust cluster($cluster)
				sum `dep_var' if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_basic

		* 0.1. baseline + controls
		eststo `dep_var'_basic_c: quietly areg `dep_var' preselection_auditing $muni_controls $mayor_controls i.term , absorb(codigo_uf) robust cluster($cluster)
				sum `dep_var' if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_basic_c
				estadd local mayor_municipal "\checkmark": `dep_var'_basic_c
	
	* 1. Broad				
		eststo `dep_var'_broad: quietly areg `dep_var' preselection_auditing broad preselection_auditing_broad i.term , absorb(codigo_uf) robust cluster($cluster)
				* Add mean dependent variable
				sum `dep_var' if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_broad
				lincom preselection_auditing + preselection_auditing_broad
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': `dep_var'_broad
				estadd local p_value `p_test': `dep_var'_broad

		*1.2. broad + controls			
		eststo `dep_var'_broad_c: quietly areg `dep_var' preselection_auditing broad preselection_auditing_broad  $muni_controls $mayor_controls i.term , absorb(codigo_uf) robust cluster($cluster)
				sum `dep_var' if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_broad_c
				estadd local mayor_municipal "\checkmark": `dep_var'_broad_c
				lincom preselection_auditing + preselection_auditing_broad
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': `dep_var'_broad_c
				estadd local p_value `p_test': `dep_var'_broad_c				

	* 2. fraction_broad		
		eststo `dep_var'_fraction: quietly areg `dep_var' preselection_auditing fraction_broad corrupt_preselection_auditing i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum `dep_var' if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_fraction
				sum fraction_broad if e(sample), mean 
				loc my_mean: display %9.3f r(mean)				
				lincom preselection_auditing + corrupt_preselection_auditing * `my_mean'	
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': `dep_var'_fraction
				estadd local p_value `p_test': `dep_var'_fraction		
				
		*2.2 fraction_broad + controls			
		eststo `dep_var'_fraction_c: quietly areg `dep_var' preselection_auditing fraction_broad corrupt_preselection_auditing $muni_controls $mayor_controls  i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum `dep_var' if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_fraction_c
				estadd local mayor_municipal "\checkmark": `dep_var'_fraction_c
				sum fraction_broad if e(sample), mean 
				loc my_mean: display %9.3f r(mean)				
				lincom preselection_auditing + corrupt_preselection_auditing * `my_mean'	
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': `dep_var'_fraction_c
				estadd local p_value `p_test': `dep_var'_fraction_c
								
	* 3. above_median_broad 							
		eststo `dep_var'_median: quietly areg `dep_var' preselection_auditing above_median_corrupt median_preselection_auditing i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum `dep_var' if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_median
				lincom preselection_auditing + median_preselection_auditing
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': `dep_var'_median
				estadd local p_value `p_test': `dep_var'_median

		*3.2. above_median_broad + controls	(Preferred specification)
		eststo `dep_var'_median_c: quietly areg `dep_var' preselection_auditing above_median_corrupt median_preselection_auditing $muni_controls $mayor_controls i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum `dep_var' if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_median_c
				estadd local mayor_municipal "\checkmark": `dep_var'_median_c
				lincom preselection_auditing + median_preselection_auditing
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': `dep_var'_median_c
				estadd local p_value `p_test': `dep_var'_median_c

	* 4. quartiles broad
		eststo `dep_var'_quart:   quietly areg `dep_var' preselection_auditing quartile2 quartile3 quartile4 quart2_preselection_auditing quart3_preselection_auditing quart4_preselection_auditing i.term, absorb(codigo_uf) robust cluster($cluster)
				sum `dep_var' if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_quart
				lincom preselection_auditing + quart4_preselection_auditing
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': `dep_var'_quart
				estadd local p_value `p_test': `dep_var'_quart

		*4.2 quartiles broad + controls
		eststo `dep_var'_quart_c: quietly areg `dep_var' preselection_auditing quartile2 quartile3 quartile4 quart2_preselection_auditing quart3_preselection_auditing quart4_preselection_auditing $muni_controls $mayor_controls   i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum `dep_var' if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": `dep_var'_quart_c
				estadd local mayor_municipal "\checkmark": `dep_var'_quart_c
				lincom preselection_auditing + quart4_preselection_auditing
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': `dep_var'_quart_c
				estadd local p_value `p_test': `dep_var'_quart_c
						
					
* EXPORT TABLE TO LATEX		
		#delimit;
			esttab `dep_var'_basic `dep_var'_basic_c `dep_var'_broad `dep_var'_broad_c `dep_var'_fraction `dep_var'_fraction_c `dep_var'_median `dep_var'_median_c `dep_var'_quart `dep_var'_quart_c
			using "tables and figures\table_d4.tex", b(3) se compress label star(* 0.10 ** 0.05 *** 0.01) replace
			mgroups( "\shortstack{Information \\ disclosure}" "Corruption"   "Share corruption"  "\shortstack{Median \\ Corruption}"   "\shortstack{Quartiles\\ Corruption}"  , pattern(1 0 1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) 
			keep(preselection_auditing_broad preselection_auditing broad corrupt_preselection_auditing fraction_broad median_preselection_auditing above_median_corrupt quartile2 quartile3 quartile4 quart2_preselection_auditing quart3_preselection_auditing quart4_preselection_auditing ) 
			/*scalars("mayor_municipal Mayor and municipal controls" "state_fe State fixed effects")  */
			stats(N mD mayor_municipal state_fe r2_a b0_b2 p_value, fmt(%9.0fc %9.3fc ) labels("Observations" "Dep. Var. Mean" "Mayor and municipal controls" "State and term FE" "Adjusted R$^2$" "$\beta_0+\beta_2 \, c_{ist}$" "p-value"))
			/*nonum*/ ar2 booktabs nonotes nomtitles title(deletethis) 
			substitute(\begin{table}[htbp]\centering \centering \caption{deletethis} /*\footnotesize*/{ \end{tabular} \end{tabular}} \end{table} %);
			#delimit cr


			
			
* Figure D.1
graph bar camp_propa_pc camp_pessoal_pc camp_gas_pc camp_bens_pc camp_serv_pc  camp_baixa_pc camp_nonspe_pc camp_outraexp_pc , graphregion(color(white))  scheme(s2Mono) 	legend(label(1 "Advertising")  label(2 "Staff") label(3 "Utilities") label(4 "Leased assets") label(5 "Third Parties") label(6 "Cash") label(7 "Not specified")  label(8 "Others") cols(4)) 
graph export "tables and figures\figure_d1a.tif", replace
 

graph bar (mean) camp_prop_pc camp_pessoas_pc camp_firm_pc camp_outrainc_pc,  graphregion(color(white)) scheme(s2Mono) 	legend(label(1 "Own resources") label(2 "Donations from people") label(3 "Donations from firms") label(4 "Others")) 
graph export "tables and figures\figure_d1b.tif", replace
 
 
* Table D5
	
	foreach dep_var of varlist camp_propa_pc camp_pessoal_pc camp_gas_pc camp_bens_pc camp_serv_pc camp_baixa_pc camp_nonspe_pc camp_outraexp_pc {
			eststo r_`dep_var': quietly areg `dep_var' before above_median_corrupt median_before $muni_controls $mayor_controls i.term if sample_camp_exp == 1, absorb(codigo_uf) robust  cluster($cluster)
				sum `dep_var' if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": r_`dep_var'
				estadd local mayor_municipal "\checkmark": r_`dep_var'
				* Add Test interactions
				lincom before + median_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': r_`dep_var'
				estadd local p_value `p_test': r_`dep_var'		
	}
	
label var before "Before"	
		#delimit;
		esttab 
			r_camp_propa_pc r_camp_pessoal_pc r_camp_gas_pc r_camp_bens_pc r_camp_serv_pc  r_camp_baixa_pc r_camp_nonspe_pc r_camp_outraexp_pc 	
			using "tables and figures\table_d5.tex", b(3) se compress label star(* 0.10 ** 0.05 *** 0.01) replace
			keep(before above_median_corrupt median_before ) stats(N mD r2_a b0_b2 p_value, fmt(%9.0fc %9.3fc ) labels("Observations" "Dep. Var. Mean" "Adjusted R$^2$" "$\beta_0+\beta_2 \, c_{ist}$" "p-value"))
			/*nonum*/ ar2 booktabs nonotes  
			substitute(\begin{table}[htbp]\centering \centering \caption{deletethis} /*\footnotesize*/{ \end{tabular} \end{tabular} \end{table} %);
			#delimit cr

 	

* Table d.6 
	global BEFORE before
	global corrupt broad	
	local Other_reg "camp_prop_pc camp_prop_pc camp_pessoas_pc camp_firm_pc camp_outrainc_pc"
		
	foreach dep_var of varlist `Other_reg' {
	    
	* Median  + controls
	    
			eststo m_c_`dep_var': quietly areg `dep_var' $BEFORE above_median_corrupt median_before $muni_controls $mayor_controls i.term if sample_camp_exp == 1, absorb(codigo_uf) robust  cluster(id_city)
				sum `dep_var' if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": m_c_`dep_var'
				estadd local mayor_municipal "\checkmark": m_c_`dep_var'
				* Add Test interactions
				lincom $BEFORE + median_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': m_c_`dep_var'
				estadd local p_value `p_test': m_c_`dep_var'				
	}
	
 eststo dir
		#delimit;
		esttab 
			m_c_camp_prop_pc m_c_camp_pessoas_pc  m_c_camp_firm_pc  m_c_camp_outrainc_pc  
			using "tables and figures\table_d6.tex", b(3) se compress label star(* 0.10 ** 0.05 *** 0.01) replace 
			keep($BEFORE above_median_corrupt median_before ) stats(N mD r2_a b0_b2 p_value, fmt(%9.0fc %9.3fc ) labels("Observations" "Dep. Var. Mean" "Adjusted R$^2$" "$\beta_0+\beta_2 \, c_{ist}$" "p-value"))
			/*nonum*/ ar2 booktabs nonotes /*nomtitles*/ title(deletethis) 
			substitute(\begin{table}[htbp]\centering \centering \caption{deletethis} /*\footnotesize*/{ \end{tabular} \end{tabular}} \end{table} %);
			#delimit cr
  	
	
	
*Table_d7
eststo clear	
*incumbent
		eststo reg_median_c_inc_2001: quietly areg camp_exp_pc before above_median_corrupt median_before  $muni_controls $mayor_controls if term == 2001, absorb(codigo_uf) robust  cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_median_c_inc_2001
				estadd local mayor_municipal "\checkmark": reg_median_c_inc_2001
				lincom before + median_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': reg_median_c_inc_2001
				estadd local p_value `p_test': reg_median_c_inc_2001

		eststo reg_median_c_inc_2005: quietly areg camp_exp_pc before above_median_corrupt median_before  $muni_controls $mayor_controls if term == 2005, absorb(codigo_uf) robust  cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_median_c_inc_2005
				estadd local mayor_municipal "\checkmark": reg_median_c_inc_2005
				lincom before + median_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': reg_median_c_inc_2005
				estadd local p_value `p_test': reg_median_c_inc_2005
				

		eststo reg_median_c_inc_radio: quietly areg camp_exp_pc before above_median_corrupt median_before  $muni_controls $mayor_controls i.term if radio == 1, absorb(codigo_uf) robust  cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_median_c_inc_radio
				estadd local mayor_municipal "\checkmark": reg_median_c_inc_radio
				lincom before + median_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': reg_median_c_inc_radio
				estadd local p_value `p_test': reg_median_c_inc_radio


		eststo reg_median_c_inc_no_radio: quietly areg camp_exp_pc before above_median_corrupt median_before  $muni_controls $mayor_controls i.term if radio == 0, absorb(codigo_uf) robust  cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_median_c_inc_no_radio
				estadd local mayor_municipal "\checkmark": reg_median_c_inc_no_radio
				lincom before + median_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': reg_median_c_inc_no_radio
				estadd local p_value `p_test': reg_median_c_inc_no_radio
		 								
										
										
* Challenger			
preserve

use "data_brasil_camp_chall.dta", clear
	
		eststo reg_median_c_chal_2001: quietly areg camp_exp_pc before above_median_corrupt median_before $muni_controls $challenger_controls if term == 2001, absorb(codigo_uf) robust  cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_median_c_chal_2001
				estadd local mayor_municipal "\checkmark": reg_median_c_chal_2001
				lincom before + median_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': reg_median_c_chal_2001
				estadd local p_value `p_test': reg_median_c_chal_2001

		eststo reg_median_c_chal_2005: quietly areg camp_exp_pc before above_median_corrupt median_before $muni_controls $challenger_controls if term == 2005, absorb(codigo_uf) robust  cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_median_c_chal_2005
				estadd local mayor_municipal "\checkmark": reg_median_c_chal_2005
				lincom before + median_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': reg_median_c_chal_2005
				estadd local p_value `p_test': reg_median_c_chal_2005
				
				

		eststo reg_median_c_chal_radio: quietly areg camp_exp_pc before above_median_corrupt median_before $muni_controls $challenger_controls i.term if radio == 1, absorb(codigo_uf) robust  cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_median_c_chal_radio
				estadd local mayor_municipal "\checkmark": reg_median_c_chal_radio
				lincom before + median_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': reg_median_c_chal_radio
				estadd local p_value `p_test': reg_median_c_chal_radio

		eststo reg_median_c_chal_no_radio: quietly areg camp_exp_pc before above_median_corrupt median_before $muni_controls $challenger_controls i.term if radio == 0, absorb(codigo_uf) robust  cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_median_c_chal_no_radio
				estadd local mayor_municipal "\checkmark": reg_median_c_chal_no_radio
				lincom before + median_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': reg_median_c_chal_no_radio
				estadd local p_value `p_test': reg_median_c_chal_no_radio
						
restore										
				

		#delimit;
			esttab reg_median_c_inc_2001 	 reg_median_c_chal_2001 
				   reg_median_c_inc_2005 	 reg_median_c_chal_2005
				   reg_median_c_inc_radio 	 reg_median_c_chal_radio 
				   reg_median_c_inc_no_radio reg_median_c_chal_no_radio			
			using "tables and figures\table_d7.tex", b(3) se compress label star(* 0.10 ** 0.05 *** 0.01) replace
			keep(before median_before above_median_corrupt   ) 
			mtitles( "Incumbent" "Challenger"  "Incumbent" "Challenger" "Incumbent" "Challenger"  "Incumbent" "Challenger") 
			mgroups( "Term 2001-2004" "Term 2005-2008"  "Local Radio" "No local radio", pattern(1 0 1 0 1 0 1 0 ) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) 
			stats(N mD mayor_municipal state_fe r2_a b0_b2 p_value, fmt(%9.0fc %9.3fc ) labels("Observations" "Dep. Var. Mean" "Mayor and municipal controls" "State and term FE" "Adjusted R$^2$" "$\beta_0+\beta_2 \, c_{ist}$" "p-value"))
			/*nonum*/ ar2 booktabs nonotes title(deletethis) 
			substitute(\begin{table}[htbp]\centering \centering \caption{deletethis} /*\footnotesize*/{ \end{tabular} \end{tabular}} \end{table} %);
			#delimit cr
						 
eststo clear	 